from fastapi import APIRouter
from app.common.result import Result
from app.model.entity.sys_user import sys_user
from ..service.user_crud import get_user,get_userId
from fastapi.responses import JSONResponse


router = APIRouter(tags=["user"])

@router.get("/id/{id}",summary="查询单个员工")
async def get_user_by_id(id):
    result = Result.success(get_userId(id))
    return result.dict()

@router.get("/usermeg",summary="查询单个员工")
async def get_user_by_id(id:int,name:str):
    new_user = sys_user(
        user_id=id,
        user_name=name,
    )
    return get_user(new_user)
